package com.qiangua.lixin.qianguakeji;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Created by Administrator on 2015/7/28 0028.
 */
public class ImitateQQ extends Activity{
    private ListView listView;
    private Intent intent;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.enteractivity);
        listView = (ListView) findViewById(R.id.listview);
        //设置适配器
        String[] arr = {"我的设备", "消息", "账号设置", "退出登录"};
        ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(ImitateQQ.this, android.R.layout.simple_list_item_1, arr);
        listView.setAdapter(arrayAdapter);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                switch (position){

                    case (0):
                        intent = new Intent(ImitateQQ.this,SecActivity.class);
                        startActivity(intent);
                        break;

                    case  (1):
                        intent = new Intent(ImitateQQ.this,Message.class);
                        startActivity(intent);
                        break;

                    case (2):

                        intent = new Intent(ImitateQQ.this,  SetActivity.class);
                        startActivity(intent);
                        break;
                    case(3):
                        intent = new Intent(ImitateQQ.this, MainActivity.class);
                        startActivity(intent);
                        break;



                }
            }
        });

    }

}


